var ns, toast, actionsheet, UIAlbumBrowser;
var app = new Vue({
    el: '#app',
    data: {
        Detail:{},
        BackImg:[],
    },
    methods: {
        // 获取商品详情信息
        getProductDetailInfo:function(ID){
            var that = this
            const params = {
                action: "getproductdetail",
                ProductID:ID
            }
            ns.post(params,function(succeed, data, err){
                if (succeed) {
                    const ProductInfo = data.ProductInfo || {}
                    that.Detail = ProductInfo.Product || {}
                    that.BackImg = ProductInfo.BackImg || []
                } else {
                    api.toast({
                        msg: err,
                        duration: 2000,
                        location: 'bottom'
                    });
                }
            })
        },
    }

});
apiready = function() {
    api.parseTapmode();
    ns = window.Foresight.Util;
    toast = new auiToast();
    actionsheet = new auiActionsheet();
    UIAlbumBrowser = api.require('UIAlbumBrowser');
    bmLocation = api.require('bmLocation');
    app.getProductDetailInfo(api.pageParam.id);
    // app.get_data();
    api.addEventListener({
        name: 'do_open_edit'
    }, function(ret, err){
        ns.openWin('product_add', '编辑商品信息');
    });
};